#ifndef __SIGNAL_H
#define __SIGNAL_H

#include "dac.h"
#include "usart.h"
#include "stdint.h"
#include "stdio.h"
#include "stm32f4xx_hal_def.h"
#include "tim.h"
#include "stdlib.h"

#define SIGNALON 1
#define SIGNALOFF 0
#define TRIGGED 1
#define TRIGGERNONE 0
#define CHANGEPARAON 1
#define CHANGEPARAOFF 0

typedef struct
{
    uint8_t signal;  //1:sine 2:triangle 3:rectangle 
    uint8_t sineOn;
    uint8_t triangleOn;
    uint8_t rectangleOn;
    uint8_t firstTrigFlag;
    uint8_t enterParameterFlag;
    union{
        uint8_t sine ;
        uint8_t triangle;
        uint8_t rectangle;
    }signalType;
} SINGNAL_TypeDef;


void mySignalInit(void);
void StartDACSine(void);
void singnalCal(char *uartBuff);

#endif